﻿using com.iot.core.annotation;
using com.iot.core.boot;
using com.iot.core.data;
using com.iot.core.data.entity;
using com.iot.core.infrastructure;
using com.iot.core.manager.htcls;
using com.iot.core.manager.htctl;
using com.iot.core.manager.id;
using com.iot.ht.Controllers.htuserlogin.data;
using com.iot.ht.Controllers.htuserlogin.service;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;

namespace com.iot.ht.Controllers.htuserlogin
{
    [ApiController]
    [Route("[controller]/[action]")]
    [Tag(Name = "在线用户", Description ="")]
    public class HtUserLoginController : ControllerBase
    {
        readonly IHtUserLoginService baseService;
         
        public HtUserLoginController(IHtUserLoginService p1)
        {
            baseService = p1;
        }


        [HttpPost]
        [Operation(Summary= "在线用户分页", Description ="" )]
        [Auth(AuthType.Login)]
        [Log(LogNeed = false, LogPin = false, LogPout = false, LogTemplete = "")]
        public async Task< Page<HtUserLogin> > PageAsync([FromBody] HtUserLoginQto mm)
        {
             
             
            var r =await baseService.PageAsync( mm);
            return r;
        }


        [HttpPost]
        [Operation(Summary = "强制离线", Description = "")]
        [Auth(AuthType.Auth)]
        [Log(LogNeed = true, LogPin = true, LogPout = true, LogTemplete = "")]
        public int Qy(BaseQto qm)
        {
            return baseService.ForceLx(qm);
        }

        [HttpPost]
        [Operation(Summary = "设置调试模式", Description = "")]
        [Auth(AuthType.Auth)]
        [Log(LogNeed = true, LogPin = true, LogPout = true, LogTemplete = "")]
        public int SetDebug(HtUserLoginDebugDto qm)
        {
            return baseService.SetDebug(qm);
        }

    }
}
